package com.lht.leetcodeDemo;

import org.junit.Test;

/**
 * @author Eric
 * @version 1.0
 * @date 2019-08-02
 */
public class SumofTwoIntegers {

    @Test
    public void test() {
        System.out.println(getSum(2,3));
    }

    public int getSum(int a, int b) {
        int half = a ^ b;
        int up = (a & b) << 1;
        if ( up!=0 ){
           return  getSum(half,up);
        }
        return half;
    }

    @Test
    public void test1(){
        String s = "1";
        System.out.println("正在判断："+ s.matches("[-]{0,1}[0-9]*"));
    }
}
